#ifndef WIDGET_H
#define WIDGET_H

#include <QJsonObject>
#include <QLabel>
#include <QMenu>
#include <QNetworkReply>
#include <QWidget>

QT_BEGIN_NAMESPACE
using namespace std;
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

private:
    Ui::Widget *ui;
    QMenu *menuQuit;
    QPoint mOffset;
    QNetworkReply *replay;

    QJsonObject todayInfo;

    int hightWd[6];//最高温度
    int lowWd[6];//最低温度

    vector<QLabel*> labelsQuality;

    void getWeatherInfo();
    void initCloseDialog();
    void initViews();

protected:

    bool eventFilter(QObject *watched,QEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;

    void mouseMoveEvent(QMouseEvent *event) override;

    //
    void drawTempLineHigh();
    void drawTempLineLow();



public slots:
    void readHttpRply();

};
#endif // WIDGET_H
